.TH std::basic_filebuf::sync 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::basic_filebuf::sync \- std::basic_filebuf::sync

.SH Synopsis
   protected:
   virtual int sync()

   If a put area exists (e.g. the file was opened for writing), calls overflow() to
   write all pending output to the file, then flushes the file as if by calling
   std::fflush.

   If a get area exists (e.g. the file was opened for reading), the effect is
   implementation-defined. Typical implementation may empty out the get area and move
   the current file position back by the corresponding number of bytes.

.SH Parameters

   \fI(none)\fP

.SH Return value

   0 in case of success, -1 in case of failure.

.SH Notes

   sync() or its equivalent is implicitly called for output streams by close(),
   seekoff(), and seekpos() and explicitly called by std::basic_streambuf::pubsync()

.SH Example

    This section is incomplete
    Reason: no example

.SH See also

   pubsync invokes sync()
           \fI(public member function of std::basic_streambuf<CharT,Traits>)\fP
   fflush  synchronizes an output stream with the actual file
           \fI(function)\fP

.SH Category:
     * Todo no example
